﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Specialist/SpecialistMaster.master" CodeBehind="Subscribe.aspx.cs" Inherits="MyHealthOnline.Specialist.Subscribe" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">

    
<asp:UpdatePanel ID="updSearch" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="grdPatients" EventName="RowCommand" />
        <asp:AsyncPostBackTrigger ControlID="btnCreateConsult" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="btnBackSearch" EventName="Click" />
    </Triggers>
    <ContentTemplate>
        Subscribe
        <br />
        <asp:Panel ID="pnlSearch" runat="server" DefaultButton="btnSearch">

            <asp:Label ID="lblError" runat="server">
            </asp:Label>
            <br />

            <table>
                <tr>
                    <td>
                        Patient No:
                    </td>
                    <td>
                        <asp:TextBox ID="txtPatientNo" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Patient Name:
                    </td>
                    <td>
                        <asp:TextBox ID="txtPatientName" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Birth Date:
                    </td>
                    <td>
                        <asp:TextBox ID="txtBirthDate" runat="server"></asp:TextBox>
                        <asp:CalendarExtender ID="calBirthDateExt" runat="server" TargetControlID="txtBirthDate">
                        </asp:CalendarExtender>
                    </td>
                </tr>
                <tr>
                    <td>
                        Gender:
                    </td>
                    <td>
                        <asp:RadioButtonList ID="rblGender" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Text="Male" Value="Male" Selected="true"></asp:ListItem>
                            <asp:ListItem Text="Female" Value="Female"></asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <asp:Button ID="btnSearch" runat="server" Text="Search Patient" 
                            onclick="btnSearch_Click" />
                    </td>
                </tr>
            </table>
            <asp:GridView ID="grdPatients" runat="server" AutoGenerateColumns="true" onrowcommand="grdPatients_RowCommand"
                             DataKeyNames="Id"  >
                <Columns>
                    <asp:ButtonField ButtonType="Button" Text="Select" CommandName="Select" />
                </Columns>
            </asp:GridView>
        </asp:Panel>
        <asp:Panel ID="pnlSubscribe" runat="server" DefaultButton="btnCreateConsult" Visible="false">

           <table>
                <tr>
                    <td>
                        Patient Name:
                    </td>
                    <td>
                        <asp:TextBox ID="txtSubscribePatientName" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Gender:
                    </td>
                    <td>
                        <asp:RadioButtonList ID="rblSubscribeGender" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Text="Male" Value="Male"></asp:ListItem>
                            <asp:ListItem Text="Female" Value="Female"></asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td>
                        Patient No:
                    </td>
                    <td>
                        <asp:TextBox ID="txtSubscribePatientNo" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Birth Date:
                    </td>
                    <td>
                        <asp:TextBox ID="txtSubscribeBirthDate" runat="server">
                        </asp:TextBox>
                        <asp:CalendarExtender ID="calSubscribeBirthDateExt" runat="server" TargetControlID="txtSubscribeBirthDate">
                        </asp:CalendarExtender>
                    </td>
                </tr>
                <tr>
                    <td>
                        Specialist:
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlSpecialists" runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        Consult Date:
                    </td>
                    <td>    
                        <asp:TextBox ID="txtConsultDate" runat="server"></asp:TextBox>
                        <asp:CalendarExtender id="calConsultDateExt" runat="server" TargetControlID="txtConsultDate"></asp:CalendarExtender>
                    </td>
                </tr>
                <tr>
                    <td>
                        Short Info:
                    </td>
                    <td>
                        <asp:TextBox ID="txtShortInfo" runat="server" Rows="5" Visible="true"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Button ID="btnBackSearch" runat="server" Text="Back to Search Patient" 
                            onclick="btnBackSearch_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnCreateConsult" runat="server" Text="Create Consult" 
                            onclick="btnCreateConsult_Click" />
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </ContentTemplate>
</asp:UpdatePanel >
    

</asp:Content>
